import java.util.Scanner;

public class work229 {

    public static void main(String[] args) {
        int n,t,i;
        Scanner sc = new Scanner(System.in);
        System.out.println("n的值为：");
        n = sc.nextInt();
        if(n % 2 == 0||n == 1){
            System.out.println("2^x?mod"+n+"=1");
        }else{
            int ans = 1,cnt = 0;
            while(ans != 1||cnt == 0){
                cnt++;
                ans=(ans*2)%n;
            }
            System.out.println("2^"+cnt+"mod"+n+"=1");
        }
    }
}
